package com.hyx.spring.bean;

import org.springframework.beans.factory.FactoryBean;

/**
 * @Author hyx
 * @Description 商品的FactoryBean，测试FactoryBean
 * @Date 2024/3/10 17:50
 * @Version 1.0
 */
public class PersonFactoryBean implements FactoryBean<Person> {

    /**
     *
     * @return 返回一个Person对象，这个对象会被注册到Spring容器中
     * @throws Exception
     */
    @Override
    public Person getObject() throws Exception {
        return new Person();
    }
    @Override
    public Class<?> getObjectType() {
        return Person.class;
    }
    /**
     * @return bean是否为单实例，true:是，false:否
     */
    @Override
    public boolean isSingleton() {
        return false;
    }
}
